<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <style>
        #box{
            width: 200px;
            height: 200px;
            background: red;
        }
    </style>
</head>
<body>
    <div id="box" class="active"></div>
    <input id="input1" type="text" value="请输入密码">
    <p id="txt">
        这是文字内容121212
        <span>这是副标题</span>
    </p>

    <script>
        var box = document.getElementById('box');   
        var input1 = document.getElementById('input1');
        var txt = document.getElementById('txt');

        // console.log(box.id)
        // console.log(box.className)

        // console.log(input1.value);

        box.onclick = function(){
            // box.style.width = '300px';
            // box.style.height = '300px';
            // box.style.background = 'green';
            box.style.cssText = 'width:300px;height:300px;background:green;'
        }


        // console.log(txt.innerHTML)

        txt.innerHTML = '123456';
    </script>
</body>
</html>